   <link rel="stylesheet" href="<?php echo base_url();?>css/themes/jquery.ui.all.css" type="text/css" />

	<script type="text/javascript">
	$(document).ready(function() { 
	  $(function() {
		applyPagination();
		function applyPagination() {
		  $(".pages a").click(function() {
		   var url = $(this).attr("href");
		   $.ajax({
			  type: "POST",
			  data: "",
			  url: url,
			  beforeSend: function() {
				$(".well-content").html("<div class='loading_div'><img src='<?php echo base_url() ?>img/loading.gif'></div>");
			  },
			  success: function(msg) {
				$("#tabledata").html(msg);
				<!-- applyPagination(); -->
			  }
			});
			 return false;
			});
		}
	  }); 
	});
	 function deleteKota(id){
			$( "#infodlg" ).html("Anda Ingin Menghapus Data Ini ?");
			$( "#infodlg" ).dialog({ title:"Info...", draggable: false, modal: true, buttons: {
					 "Ya": function(){
							  $.ajax({
									url:'<?php echo base_url(); ?>m_sppd_kota/deleteKota/'+id,		 
									type:'POST',
									data:"",
									success:function(data){ 
										 getdata();
									}  
								});			
							  $(this).dialog("close");
					  } ,
				  "Tutup": function(){
			   $(this).dialog("close");
				}
		 }});		
	 }
	 function getdata(){
	 	  $.ajax({
			  type: "POST",
			  data: "",
			  url:'<?php echo base_url(); ?>m_sppd_kota/search/',	
			  beforeSend: function() {
				$(".well-content").html("<div class='loading_div'><img src='<?php echo base_url() ?>img/loading.gif'></div>");
			  },
			  success: function(msg) {
				$("#tabledata").html(msg);
			  }
			});
	 }
 	 
	 function addUpsppd(id){		 
	 $("#idsppd").val(id);
		$.ajax({
			url:'<?php echo base_url(); ?>m_sppd_kota/add/'+id,		 
			type:'POST',
			data:$('#aksiform').serialize(),
			success:function(data){ 
				$( "#infodlg" ).html(data);
				$( "#infodlg" ).dialog({ title:"Info...", draggable: false, modal: true, buttons: {
						 "Ya": function(){
								  $.ajax({
										url:'<?php echo base_url(); ?>m_sppd_kota/simpan/'+id,		 
										type:'POST',
										data:$('#frmsave').serialize(),
										success:function(data){ 
											 getdata();
										}  
									});			
								  $(this).dialog("close");
						  } ,
					  "Tutup": function(){
				   $(this).dialog("close");
					}
			 }});		
			}  
		});		
	 }
	</script>
    
<div id="tabledata">
<div class="span12">
 <a  onclick="return addUpsppd(0)" class="dark_green btn">Tambah Data Kota</a><br>          
<br>
											<div class="well grey">
												<div class="well-header">
													<h5>List Master Kota  </h5>
													</div>
										
													<div class="well-content">
													<div class="table_options top_options">
													</div>

 <table class="table multimedia table-striped table-hover">
                                    <thead>
                                        <tr>
                                        	<th>Kota</th>
											<th>Actions</th>
                                        </tr>
                                    </thead>
                                    <tbody>
									 	<?php  if(!empty($query)) { foreach($query as $row) { ?> 
                                        <tr> 
                                           
                                            <td><?php echo $row->nama_kota ?></td>
                                             <td>
                                               <div class="btn-group">
                                                    <a class="btn simptip-position-left"  onclick="return addUpsppd(<?php echo $row->id ?>)"
                                                     data-tooltip="Update Master Kota" href="#">
													<i class="icon-arrow-right"></i></a>
                                                    <a class="btn simptip-position-left" onclick="return deleteKota(<?php echo $row->id ?>)"><i class="icon-trash"></i></a>                                                </div> 
											</td>
                                        </tr>
										 
										<?php }} ?>
                                    </tbody>
                                </table><br>
								 <p class="pages"> <?php echo $this->pagination->create_links(); ?></p>		
								 </div>
								 
								 <div class="table_options bottom_options">
													</div>
											  </div>
											</div>
										</div>